import LogFactory from "@/log/LogFactory.ts";

import ProTree from "@/common/tree/ProTree.tsx";
import {useLocation} from "react-router-dom";
import {SecurityUser} from "@/type/SecurityUser";
const log = LogFactory.getLogger("UserAuthComponent.UserAuthMenu");

/**
 * 数据的节点类型扩展类型
 */
type Extend = {
    /**
     * 用户角色说明
     */
    explain: string,
}
const UserAuthMenu = () => {
    const user = useLocation().state as SecurityUser;
    log.debug("用户菜单管理组件加载");


    return (
        <ProTree<Extend>
            id={user.id}
            // titleRender={titleRender}
            treeRenderUrl={"/manager/admin/user-menu/authority-tree/" + user.id}
            checkStrictly={true}
            expandAll
        />
    );
};

export default UserAuthMenu;